//
//  MusicManager.h
//  老司机发车了
//
//  Created by SuperNing on 16/8/9.
//  Copyright © 2016年 斌. All rights reserved.
//

#import <Foundation/Foundation.h>

#import <AVFoundation/AVFoundation.h>

#import "DetailListModel.h"
#import "PlayerModel.h"


@protocol MusicPlayerDelegate<NSObject>

- (void)autoRefreshProgress:(float)progress;

@end


@interface MusicManager : NSObject

// 歌曲下标
@property (nonatomic, assign) NSInteger index;
// 当前所有歌曲模型
@property (nonatomic, strong) NSMutableArray *musicArray;
// 播放标志位
@property (nonatomic, assign) BOOL isPlay;
//

@property (nonatomic, strong) AVPlayerItem *playerItem;

@property (nonatomic, assign) NSInteger playStyle;

@property (nonatomic, weak) id<MusicPlayerDelegate> delegate;

@property (nonatomic, strong)PlayerModel *playerModel;

@property (nonatomic, assign)float tempProgress;

+ (instancetype)shareMusicManager;

- (void)seekToTime:(float)progress;

- (void)startPlayMusic;

- (void)stopPlayMusic;

- (void)previousMusic;
- (void)nextMusic;

- (void)downloadMusic;

- (void)loadSongInfo;


@end
